Page({

  /**
   * 页面的初始数据
   */
  data: {
    schema: [{
      label:'权限',
      prop:'scope',
      type:'picker',
      valueOptions:[
        'scope.userLocation',
        'scope.userFuzzyLocation',
        'scope.userLocationBackground',
        'scope.record',
        'scope.camera',
        'scope.bluetooth',
        'scope.writePhotosAlbum',
        'scope.addPhoneContact',
        'scope.addPhoneCalendar',
        'scope.werun'
      ],
      labelOptions:[
        '精确地理位置',
        '模糊地理位置',
        '后台定位',
        '麦克风',
        '摄像头',
        '蓝牙',
        '添加到相册',
        '添加到联系人',
        '添加到日历',
        '微信运动步数'
      ]
    }],
    formData: {
      scope: 'scope.userLocation'
    },
    title: '',
    result: '',
    zh:'',
    apiType: '',
    remark: '',
    webUrl: '',
    apiName: '',
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.setData({
      apiType: options.zh,
      title: options.title,
      zh: options.zh,
      remark: options.remark,
      webUrl: options.webUrl
    })
  },
  getFormData(e){
    this.setData({
      formData:e.detail.formData
    })
  },
  getPermission() {
    wx.authorize({
      scope: this.data.formData.scope,
      complete: (res)=>{
        this.setData({
          result:res
        })
      }
    })
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})